package com.sz.biz.logistics.base.dto;

import com.sz.biz.logistics.base.entity.Region;
import com.sz.biz.common.base.dto.CountryArea;
import com.sz.common.base.entity.Entity;
import com.sz.common.base.utils.EntityUtils;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Function: 分区Dto <br>
 * Author: hpeng.wang <br>
 * Date: 2017-02-15 15:44:00
 */
public class RegionDto implements Entity {
    /**
     * 自增长id
     */
    private Integer id;
    /**
     * 供价格之类的表使用的uuid值
     */
    private String uid;

    /**
     * 外键id，关联biz_region_schema的uid
     */
    private String schemaId;

    /**
     * 分区编码
     */
    private String code;

    /**
     * 分区名称
     */
    private String name;

    /**
     * 激活时间
     */
    private Date activeTime;
    private List<CountryArea> areas = new ArrayList<>();
    private List<CountryPort> ports = new ArrayList<>();

    /**
     * 创建者id
     */
    private Integer createUserId;

    /**
     * 最后更新者id
     */
    private Integer lastUpdateUserId;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 最后更新时间
     */
    private Date lastUpdateTime;

    /**
     * 备注
     */
    private String description;


    /**
     * 预留字段，gis路径
     */
    private String polygon;


    private List<Postcode> postcodes = new ArrayList<>();


    public RegionDto(Region region) {
        EntityUtils.copyPropertiesIgnoreNull(region, this);
    }

    public RegionDto() {
        super();
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getSchemaId() {
        return schemaId;
    }

    public void setSchemaId(String schemaId) {
        this.schemaId = schemaId;
    }

    public Date getActiveTime() {
        return activeTime;
    }

    public void setActiveTime(Date activeTime) {
        this.activeTime = activeTime;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<CountryArea> getAreas() {
        return areas;
    }

    public void setAreas(List<CountryArea> areas) {
        this.areas = areas;
    }

    public List<CountryPort> getPorts() {
        return ports;
    }

    public void setPorts(List<CountryPort> ports) {
        this.ports = ports;
    }

    public Integer getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(Integer createUserId) {
        this.createUserId = createUserId;
    }

    public Integer getLastUpdateUserId() {
        return lastUpdateUserId;
    }

    public void setLastUpdateUserId(Integer lastUpdateUserId) {
        this.lastUpdateUserId = lastUpdateUserId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getLastUpdateTime() {
        return lastUpdateTime;
    }

    public void setLastUpdateTime(Date lastUpdateTime) {
        this.lastUpdateTime = lastUpdateTime;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }


    public String getPolygon() {
        return polygon;
    }

    public void setPolygon(String polygon) {
        this.polygon = polygon;
    }

    public List<Postcode> getPostcodes() {
        return postcodes;
    }

    public void setPostcodes(List<Postcode> postcodes) {
        this.postcodes = postcodes;
    }

    /**
     * 向地区中添加数据
     *
     * @param area
     */
    public void putArea(CountryArea area) {
        areas.add(area);
    }
    /**
     * 向运输工具中添加数据
     *
     * @param port
     */
    public void putPorts(CountryPort port) {
        ports.add(port);
    }

    /**
     * 向邮编中添加数据
     *
     * @param postcode
     */
    public void putPostcode(Postcode postcode) {
        postcodes.add(postcode);
    }
}

